import React, { Component } from 'react'
import qs from 'querystring'

export default class details extends Component {
  render() {
    let userInfo = {}
    if(Object.keys(this.props.match.params).length) userInfo = this.props.match.params
    if(this.props.location.search) userInfo = qs.parse(this.props.location.search.replace("?", ""))
    if(this.props.location.state) userInfo = this.props.location.state

    return (
      <div className="details">
        <div>用户ID：{userInfo.id}</div>
        <div>用户名称：{userInfo.name}</div>
      </div>
    )
  }
}
